﻿using System;
using System.Collections.Generic;
using System.Web;
using Itop.YHPC.Model;
using Itop.YHPC.BLL;

namespace Itop.YHPC.controller {
    public class sysgroupController {
        static sysgroupBLL bll;

        public static sysgroupBLL Bll {
            get {
                if (bll == null)
                    bll=Global.GetService<sysgroupBLL>();
                return sysgroupController.bll; }
        }
        public static IList<sysgroup> GetList(string where){
            return Bll.SelectByWhere(where);
        }
        public static string GetListJson(string where) {
            IList<sysgroup> list = Bll.SelectByWhere(where);
            return Newtonsoft.Json.JsonConvert.SerializeObject(list);
        }
        public static object Insert(sysgroup obj) {
           return  Bll.Insert(obj);
        }
        public static object Update(sysgroup obj) {
            return Bll.Update(obj);
        }
        public static object Delete(string key) {
            return Bll.Delete(key);
        }
        public static object UpdateJson(string strUser) {
            sysgroup obj = Newtonsoft.Json.JsonConvert.DeserializeObject<sysgroup>(strUser);
            if (obj == null) return null;
            return Bll.Update(obj);
        }
    }
}
